symbol-check: Only ELFv1 ppc64 doesn't set .note.GNU-stack#1215
Merged
Conversation
Contributor
Author
|
Successful powerpc64-unknown-linux-musl CI run: https://github.com/Gelbpunkt/compiler-builtins/actions/runs/25989194981/job/76392149895 |
tgross35
reviewed
May 18, 2026
4e40e1c to
4c5cdb7
Compare
tgross35
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
powerpc64-unknown-linux-gnucurrently is an ELFv1 target, whilepowerpc64-unknown-linux-muslis an ELFv2 target.Big-endian and little-endian ELFv2 targets both behave normally: they emit
.note.GNU-stack. Therefore, currently the tests would fail on big-endian powerpc64 with ELFv2 ABI.To determine whether we need to special-case powerpc64, we should check the ABI instead of the endianness. The problem here is that the
e_flagspart of the ELF header is actually0in the output ofcc -O0 -ffunction-sections -fdata-sections -fPIC -m64 -mabi=elfv2 -Wall -Wextra -o missing_gnu_stack_section.o -c missing_gnu_stack_section.S, the output of that command is bit-for-bit identical on ELFv1 and ELFv2 hosts. In order to know when to allow an unset.note.GNU-stackwe therefore must set.abiversion 2to be able to tell them apart from the ELF header.This makes all tests pass on
powerpc64-unknown-linux-musl.